{extend name="default/template/base_index" /}
{block name="area_header"}
	<link rel="stylesheet" type="text/css" media="all" href="__CDN__/jquery-datetimepicker/jquery.datetimepicker.css">
	<script type="text/javascript" src="__CDN__/jquery-datetimepicker/jquery.datetimepicker.js"></script>
{/block}
{block name="area_body"}
	{include file="default/Widget/topbar" /}
	<div class="admin-main container-fluid">
		{include file="default/Widget/left" /}
		<div class="admin-main-content">
			{include file="default/Widget/breadcrumb" /}
        <div class="alert alert-info">
             注意:最多3级类目,点击类目名称进入子类目,子类目继承父类属性和规格
        </div>

				<!-- 过滤\查询按钮 -->
				<div class="filter-controls">
					<form action="{:url('Testpaper/index')}" method="post" class="form-inline" id="fm">
						<div class="form-group">
							<label>试卷标题</label>
							<input type="text" name="name" placeholder="请输入试卷标题" value="{$title}" class="form-control input-short input-sm"/>
						</div>

						<button type="submit" class="btn btn-default btn-sm"><i class="fa fa-search"></i>{:L('BTN_SEARCH')}</button>
					</form>
				</div>

				<!-- 操作按钮 -->
				<div class="btn-controls">
					<a class="btn btn-primary btn-sm" href="{:url('Admin/Testpaper/add')}"><i class="fa fa-plus"></i>试卷添加</a>
				</div>
				<table class="table table-striped table table-hover table-condensed">
					<thead>
						<tr>
							<th>
								<input type="checkbox" class="selectall" onclick="myUtils.selectall(this,'.selectitem');" />
							</th>
							<th width="180px;">
								试卷标题</th>
							<th>试卷概述</th>
							<th>题目编辑</th>
							<th>
								操作</th>
						</tr>
					</thead>
					<tbody>
						{empty name="list"}
							<tr>
								<td colspan="5" class="text-center">{:L('NO_DATA')}</td>
							</tr>
							{else/}
							{volist name="list" id="vo"}
								<tr>
									<td>
										<input type="checkbox" value="{$vo.id}" name="ids[]" class="selectitem" /></td>
									<td>{$vo.title}</td>
									<td>{$vo.summary}</td>
									<td><a class="btn btn-sm btn-primary" href="{:url('Testpaper/edquestion',['id'=>$vo['id'],'dt_class'=>$vo['dt_class']])}">题目编辑</a>

									<td>
										<a href="{:url('Testpaper/edit',['id'=>$vo['id']])}" class="btn btn-sm btn-default"><i class="fa fa-edit"></i>编辑</a>
										<a href="{:url('Testpaper/delete',['id'=>$vo['id']])}" class="btn btn-sm btn-danger ajax-get confirm"><i class="fa fa-trash"></i>删除</a></td>
								</tr>

							{/volist}
						{/empty}
					</tbody>
				</table>
			<div>{$show}</div>
			</div>
		</div>
		<!-- END admin-main-content -->
	</div>
		<!-- END admin-main-->
{/block}

{block name="area_footer"}
	<script>
		$(function () {
			$('#startdatetime').datetimepicker({
				lang: 'ch',
				format:'Y-m-d',
				timepicker:false,
			});
			$('#enddatetime').datetimepicker({
				lang: 'ch',
				format:'Y-m-d',
				timepicker:false,
			});
			$("#sel").change(function () {
				$('#fm').submit();
			})
		})
	</script>
{/block}